<?php
namespace Home\Controller;
use Common\Controller\HomebaseController;
class IndexController extends  HomebaseController {
    public function index(){

        $articleModel = new \Common\Model\ArticleModel();
        $where = array('is_recycle'=>0,'status'=>1);
        $order = " add_time DESC , aid DESC";
        $setConfig = array(
            'next' => 'Next →',
            'prev' => '← Previous',
        );
		$pageSize=4; //每页显示$pageSize条
        $data = $articleModel->getListData($pageSize,$where,$order,$setConfig);
		
        $this->assign('data',$data);
        $this->assign('cocolait','Cocolait博客-首页');
//      $this->display();
		if($data){
			$data['status']=1;
			$data['mes']='数据读取成功';
		}else{
			$data['status']=0;
			$data['mes']='无数据';
		}
		$data['pageSize']=$pageSize;
		echo json_encode($data) ;
    }
}